{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <center>豆瓣电影数据分析</center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过对电影文件（dianying.csv）中的电影票房、导演票房、电影类型、导演与电影类型等的统计，综合运用文件读取、pandas数据处理和matplotlib绘图功能，全面掌握Python程序设计与数据处理方法，从而使读者具备大数据处理的基本能力。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1 分析目标\n",
    "1. 哪种类型的电压数量最多\n",
    "2. 分析每个导演擅长的电影类型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2 分析内容"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3 分析步骤"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.1 csv文件信息读取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "#设置中文标签的显示\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei']  #设置显示中文字体"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "film_date=pd.read_csv(\"dianying.csv\",delimiter=\";\",header=None,encoding=\"utf-8\",names=['电影名称','上线时间',\"下线时间\",\"公司\",\"导演\",\"主演\",\"类型\",\"票房\",\"城市\"])\n",
    "film_date"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.2 数据清洗\n",
    "> 提取信息，去空去重，规范化处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#输出初始行数，通过比较来理解去除操作\n",
    "print(\"原始行数：\",len(film_date))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "#去重操作\n",
    "film_date=film_date.drop_duplicates().reset_index().drop(\"index\",axis=1)\n",
    "film_date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 提取我们所需要的列\n",
    "film_date=film_date[['电影名称','导演','类型','票房']].dropna()\n",
    "film_date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#对电影类型进行处理\n",
    "film_date['类型']==film_date['类型'].str[:2]\n",
    "film_date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "#去掉（万）\n",
    "film_date['票房']=film_date['票房'].str.split('）',expand=True)[1].astype(np.float64)\n",
    "film_date"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.3 数据分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.1 对电影票房进行统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#对电影里面的票房进行求和\n",
    "film_box_office=film_date.groupby(film_date[\"电影名称\"])[\"票房\"].sum()\n",
    "type(film_box_office)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>电影名称</th>\n",
       "      <th>票房</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>《天将雄师》</td>\n",
       "      <td>52102.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>《恶棍天使》</td>\n",
       "      <td>38970.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>《百团大战》</td>\n",
       "      <td>24823.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>《前任2：备胎反击战》</td>\n",
       "      <td>13201.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>《万物生长》</td>\n",
       "      <td>11454.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>《怦然星动》</td>\n",
       "      <td>11157.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>《冲上云霄》</td>\n",
       "      <td>10943.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>《失孤》</td>\n",
       "      <td>10839.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>《破风》</td>\n",
       "      <td>10003.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>《一路惊喜》</td>\n",
       "      <td>7796.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>《一念天堂》</td>\n",
       "      <td>7465.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>《少年班》</td>\n",
       "      <td>3040.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>《既然青春留不住》</td>\n",
       "      <td>3001.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>《坏蛋必须死》</td>\n",
       "      <td>2837.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>《将错就错》</td>\n",
       "      <td>2781.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>《简单爱》</td>\n",
       "      <td>1163.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>《分手再说我爱你》</td>\n",
       "      <td>1039.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>《闯入者》</td>\n",
       "      <td>725.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>《浪漫天降》</td>\n",
       "      <td>526.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>《探灵档案》</td>\n",
       "      <td>204.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>《爱之初体验》</td>\n",
       "      <td>158.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>《最美的时候遇见你》</td>\n",
       "      <td>60.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>《紫霞》</td>\n",
       "      <td>24.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>《爱情魔发师》</td>\n",
       "      <td>13.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           电影名称       票房\n",
       "7        《天将雄师》  52102.4\n",
       "12       《恶棍天使》  38970.0\n",
       "19       《百团大战》  24823.8\n",
       "5   《前任2：备胎反击战》  13201.2\n",
       "2        《万物生长》  11454.4\n",
       "11       《怦然星动》  11157.3\n",
       "3        《冲上云霄》  10943.1\n",
       "8          《失孤》  10839.5\n",
       "20         《破风》  10003.7\n",
       "1        《一路惊喜》   7796.8\n",
       "0        《一念天堂》   7465.5\n",
       "10        《少年班》   3040.2\n",
       "14    《既然青春留不住》   3001.8\n",
       "6       《坏蛋必须死》   2837.8\n",
       "9        《将错就错》   2781.8\n",
       "21        《简单爱》   1163.5\n",
       "4     《分手再说我爱你》   1039.2\n",
       "23        《闯入者》    725.2\n",
       "16       《浪漫天降》    526.4\n",
       "13       《探灵档案》    204.6\n",
       "17      《爱之初体验》    158.5\n",
       "15   《最美的时候遇见你》     60.8\n",
       "22         《紫霞》     24.6\n",
       "18      《爱情魔发师》     13.8"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#将我们得到的series格式转化为dataframe，并按照降序去排序\n",
    "film_box_office=film_box_office.reset_index().sort_values(by=\"票房\",ascending=False)\n",
    "film_box_office"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "#去票房前五位\n",
    "film_box_office_5=film_box_office.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAGPCAYAAABCs5ejAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8GearUAAAgAElEQVR4nO3debxdZX3v8c8vIYEwGTARGxACiiMKFlRApME6MGmVWofSVhzAVpxvrQjotY70VsTaqi0KFkWR4SqKIygioKAGLeAIVw0KiAYJszL+7h+/55Cdk/AEcs4+Q/J5v155Ze+199n7WXuvtb7PtNaOzESSpHszY7ILIEma2gwKSVKXQSFJ6jIoJEldBo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/D3B+RDyNqtlvMDD77nfUhRb/kmpNvB84J+okw30zc7eBt70jIl4PfD3bSYarKNdIrXzvHLjEyXQzlb/7yWBQSNPTbtQ5BmdFxDJqEHYhNTX3l9RY0tnUTKSt2tjBE6iLN+4bEc+irmO1HnXm8HuoH1C6qb3+y4APRl3peB413feWqIvpXUbN9lvJSHfcdA4JrcyuJ2maieWXmridOtgHda7CT2gXbcy63PVrqesmvT0zX9gO+rOo2WoXUfP8r46IjwOHtvNg5lID998beM3/C5y8Lreu13W2KKTpZ+QyKxcAR7fzdl5Izf/fnGoJ7EGd53EWcE1EPLSd/LWAmv//nYGp3HOAL0ZEsvxKvodQVyi+bvSb34/zKrSWMCik6WcTqqWwN3Vgv5m6XtKGVItiKXX5kAupk9l+Qs1u+jl1Qcb/BzwnIm6mLvb4k/Z65wxM/b3nZFFY8dfnDIl1j9d6kqaf/ahL2p/B8sreN4DLM/MN1Hkfi6gTAfegzjjeuT3vNur6SI+hrny7e2a+LDOPX9X5IVkMhnWcQSFNP9+nfiPkbupSEyPLHhn1a2sLqbOIv0ydx7Axy3+p7Xbq8hNfyvplQiJiRiy/4qq0EruepOnnIupqpn8CbBF1uevvR8QfgNOzfjb3a9F+0zwiXkp1Uc2gLkx5zyW5wa4krZ61CGmaycxrM/Nkqvvoy8BLImI+NftpQUQ8neW/xkhm/m1mnjxBF9bTWsjpsdI0M3JSW9RvKj+MumLrh6jfPbkiV/yRIGnMDAppGvNSE5oIBoUkqcsxCklSl0EhSeoyKCRJXQaFJKnLoJAkdRkUkqSu/w81nk4T18uWmAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#绘图\n",
    "fig=plt.figure(figsize=(6,6))\n",
    "ax=fig.add_subplot(111)\n",
    "ax.set_title(\"票房总计\")\n",
    "ax.set_ylabel(\"万元\")\n",
    "ax.set_xticklabels(film_box_office_5[\"电影名称\"],rotation=15)\n",
    "ax.bar(film_box_office_5[\"电影名称\"],film_box_office_5['票房'])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.2 对电影类型进行统计"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.3 对导演票房进行统计"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3.4 对导演所导电影的类型进行统计"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.4 绘图并分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 测试"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
